package com.tiancheng.trade.payment.channel.enums;

import java.util.Arrays;
import java.util.Optional;

/**
 * 渠道订单状态
 *
 * @author kellen
 * @date 2024/4/20
 */
public enum ChannelOrderStatusEnum {

    wait, ing, success, fail;

    public static ChannelOrderStatusEnum getByCode(String code) {
        Optional<ChannelOrderStatusEnum> found = Arrays.stream(ChannelOrderStatusEnum.values()).filter(c -> c.name().equals(code)).findFirst();
        return found.orElse(null);
    }
}
